<template>
    <div id="root">
        <div id="navbar">
            <button id="back">Back</button>
            <div id="title">Home</div>
            <div id="blank"/>
        </div>
        <div id="home_content">
           <img src="../assets/logo.png"/>
            <div>
                This is {{pageName}}
            </div>
            <div v-show="pageName == 'Shared'" id="share_panel">
                <Shared name='xmt1' v-bind:items="[{name:'name1',id:0},{name:'name2',id:1}]"></Shared>
            </div>
        </div>
        <div id="tabbar">
          <button id="tabitem" @click="tabClick('Home')">Home</button>
          <button id="tabitem" @click="tabClick('Shared')">Shared</button>
          <button id="tabitem" @click="tabClick('Me')">Me</button>
        </div>
    </div>
</template>
<script>
import Shared from './Shared.vue'
export default {
  name: "Home",
  data(){
    return {
      pageName:'home'
    }
  },
  methods:{
    tabClick(name){
      this.pageName = name
    }
  },
  components:{
    Shared
  }
};
</script>

<style>
#root {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: bisque;
  align-items: stretch;
}
#back {
  height: 50px;
  width: 50px;
  background-color: royalblue;
  margin-left: 5px;
}
#blank {
  height: 50px;
  width: 50px;
  margin-right: 5px;
  background-color: royalblue;
}
#navbar {
  display: flex;
  flex-direction: row;
  height: 65px;
  background-color: aqua;
  align-items: center;
  justify-content: space-between;
}
#home_content {
  font-size: 15px;
  text-align: center;
  height: 100%;
}
#tabbar {
  display: inline-flex;
  flex-direction: row;
  background-color: blue;
  height: 65px;
  justify-content: space-around;
}
#tabitem {
  background-color: green;
  text-align: center;
  color:white;
  padding: 5px;
  flex: 1;
  border-right: 1px solid;
  text-decoration: none;
  display: block;
}
#share_panel{
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
